antlr_target(UniASTLexer UniASTLexer.g4
            PACKAGE UniAST
            LEXER
            )

antlr_target(UniASTParser UniASTParser.g4
            PACKAGE UniAST
            DEPENDS_ANTLR UniASTLexer
            PARSER
            LISTENER
            VISITOR
            COMPILE_FLAGS -lib 
            ${ANTLR_UniASTLexer_OUTPUT_DIR}
            )

include_directories(${ANTLR_UniASTLexer_OUTPUT_DIR}) 
set(ANTLR_UniASTLexer_OUTPUT_DIR ${ANTLR_UniASTLexer_OUTPUT_DIR} CACHE STRING "ANTLR_UniASTLexer_OUTPUT_DIR")
include_directories(${ANTLR_UniASTParser_OUTPUT_DIR})
set(ANTLR_UniASTParser_OUTPUT_DIR ${ANTLR_UniASTParser_OUTPUT_DIR} CACHE STRING "ANTLR_UniASTParser_OUTPUT_DIR")

add_library(antlr_generated 
    ${ANTLR_UniASTLexer_CXX_OUTPUTS} 
    ${ANTLR_UniASTParser_CXX_OUTPUTS}
)

target_link_libraries(antlr_generated
    PUBLIC
    antlr4_static
)